3.2.3 \(\int \frac {(g+h x) (d+e x+f x^2)}{\sqrt {a+c x^2}} \, dx\) [103]

Optimal. Leaf size=136 \[ \frac {f (g+h x)^2 \sqrt {a+c x^2}}{3 c h}-\frac {\left (2 \left (2 a f h^2+c \left (f g^2-3 h (e g+d h)\right )\right )+c h (f g-3 e h) x\right ) \sqrt {a+c x^2}}{6 c^2 h}+\frac {(2 c d g-a (f g+e h)) \tanh ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a+c x^2}}\right )}{2 c^{3/2}} \]

[Out]

1/2*(2*c*d*g-a*(e*h+f*g))*arctanh(x*c^(1/2)/(c*x^2+a)^(1/2))/c^(3/2)+1/3*f*(h*x+g)^2*(c*x^2+a)^(1/2)/c/h-1/6*(
4*a*f*h^2+2*c*(f*g^2-3*h*(d*h+e*g))+c*h*(-3*e*h+f*g)*x)*(c*x^2+a)^(1/2)/c^2/h

________________________________________________________________________________________

Rubi [A]
time = 0.10, antiderivative size = 135, normalized size of antiderivative = 0.99, number of steps used = 4, number of rules used = 4, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.148, Rules used = {1668, 794, 223, 212} \begin {gather*} \frac {\tanh ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a+c x^2}}\right ) (2 c d g-a (e h+f g))}{2 c^{3/2}}-\frac {\sqrt {a+c x^2} \left (2 \left (2 a f h^2-3 c h (d h+e g)+c f g^2\right )+c h x (f g-3 e h)\right )}{6 c^2 h}+\frac {f \sqrt {a+c x^2} (g+h x)^2}{3 c h} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((g + h*x)*(d + e*x + f*x^2))/Sqrt[a + c*x^2],x]

[Out]

(f*(g + h*x)^2*Sqrt[a + c*x^2])/(3*c*h) - ((2*(c*f*g^2 + 2*a*f*h^2 - 3*c*h*(e*g + d*h)) + c*h*(f*g - 3*e*h)*x)
*Sqrt[a + c*x^2])/(6*c^2*h) + ((2*c*d*g - a*(f*g + e*h))*ArcTanh[(Sqrt[c]*x)/Sqrt[a + c*x^2]])/(2*c^(3/2))

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 223

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 794

Int[((d_.) + (e_.)*(x_))*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((e*f + d*g)*(2*p
+ 3) + 2*e*g*(p + 1)*x)*((a + c*x^2)^(p + 1)/(2*c*(p + 1)*(2*p + 3))), x] - Dist[(a*e*g - c*d*f*(2*p + 3))/(c*
(2*p + 3)), Int[(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g, p}, x] &&  !LeQ[p, -1]

Rule 1668

Int[(Pq_)*((d_) + (e_.)*(x_))^(m_.)*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{q = Expon[Pq, x], f = Coeff
[Pq, x, Expon[Pq, x]]}, Simp[f*(d + e*x)^(m + q - 1)*((a + c*x^2)^(p + 1)/(c*e^(q - 1)*(m + q + 2*p + 1))), x]
 + Dist[1/(c*e^q*(m + q + 2*p + 1)), Int[(d + e*x)^m*(a + c*x^2)^p*ExpandToSum[c*e^q*(m + q + 2*p + 1)*Pq - c*
f*(m + q + 2*p + 1)*(d + e*x)^q - f*(d + e*x)^(q - 2)*(a*e^2*(m + q - 1) - c*d^2*(m + q + 2*p + 1) - 2*c*d*e*(
m + q + p)*x), x], x], x] /; GtQ[q, 1] && NeQ[m + q + 2*p + 1, 0]] /; FreeQ[{a, c, d, e, m, p}, x] && PolyQ[Pq
, x] && NeQ[c*d^2 + a*e^2, 0] &&  !(EqQ[d, 0] && True) &&  !(IGtQ[m, 0] && RationalQ[a, c, d, e] && (IntegerQ[
p] || ILtQ[p + 1/2, 0]))

Rubi steps

\begin {align*} \int \frac {(g+h x) \left (d+e x+f x^2\right )}{\sqrt {a+c x^2}} \, dx &=\frac {f (g+h x)^2 \sqrt {a+c x^2}}{3 c h}+\frac {\int \frac {(g+h x) \left ((3 c d-2 a f) h^2-c h (f g-3 e h) x\right )}{\sqrt {a+c x^2}} \, dx}{3 c h^2}\\ &=\frac {f (g+h x)^2 \sqrt {a+c x^2}}{3 c h}-\frac {\left (2 \left (c f g^2+2 a f h^2-3 c h (e g+d h)\right )+c h (f g-3 e h) x\right ) \sqrt {a+c x^2}}{6 c^2 h}+\frac {(2 c d g-a f g-a e h) \int \frac {1}{\sqrt {a+c x^2}} \, dx}{2 c}\\ &=\frac {f (g+h x)^2 \sqrt {a+c x^2}}{3 c h}-\frac {\left (2 \left (c f g^2+2 a f h^2-3 c h (e g+d h)\right )+c h (f g-3 e h) x\right ) \sqrt {a+c x^2}}{6 c^2 h}+\frac {(2 c d g-a f g-a e h) \text {Subst}\left (\int \frac {1}{1-c x^2} \, dx,x,\frac {x}{\sqrt {a+c x^2}}\right )}{2 c}\\ &=\frac {f (g+h x)^2 \sqrt {a+c x^2}}{3 c h}-\frac {\left (2 \left (c f g^2+2 a f h^2-3 c h (e g+d h)\right )+c h (f g-3 e h) x\right ) \sqrt {a+c x^2}}{6 c^2 h}+\frac {(2 c d g-a (f g+e h)) \tanh ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a+c x^2}}\right )}{2 c^{3/2}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.41, size = 96, normalized size = 0.71 \begin {gather*} \frac {\sqrt {a+c x^2} \left (-4 a f h+c \left (6 e g+6 d h+3 f g x+3 e h x+2 f h x^2\right )\right )+3 \sqrt {c} (-2 c d g+a f g+a e h) \log \left (-\sqrt {c} x+\sqrt {a+c x^2}\right )}{6 c^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((g + h*x)*(d + e*x + f*x^2))/Sqrt[a + c*x^2],x]

[Out]

(Sqrt[a + c*x^2]*(-4*a*f*h + c*(6*e*g + 6*d*h + 3*f*g*x + 3*e*h*x + 2*f*h*x^2)) + 3*Sqrt[c]*(-2*c*d*g + a*f*g
+ a*e*h)*Log[-(Sqrt[c]*x) + Sqrt[a + c*x^2]])/(6*c^2)

________________________________________________________________________________________

Maple [A]
time = 0.09, size = 126, normalized size = 0.93

method result size
risch \(-\frac {\left (-2 h f c \,x^{2}-3 e h x c -3 f g x c +4 a f h -6 c d h -6 c e g \right ) \sqrt {c \,x^{2}+a}}{6 c^{2}}-\frac {\ln \left (x \sqrt {c}+\sqrt {c \,x^{2}+a}\right ) a e h}{2 c^{\frac {3}{2}}}-\frac {\ln \left (x \sqrt {c}+\sqrt {c \,x^{2}+a}\right ) a f g}{2 c^{\frac {3}{2}}}+\frac {d g \ln \left (x \sqrt {c}+\sqrt {c \,x^{2}+a}\right )}{\sqrt {c}}\) \(122\)
default \(h f \left (\frac {x^{2} \sqrt {c \,x^{2}+a}}{3 c}-\frac {2 a \sqrt {c \,x^{2}+a}}{3 c^{2}}\right )+\left (e h +g f \right ) \left (\frac {x \sqrt {c \,x^{2}+a}}{2 c}-\frac {a \ln \left (x \sqrt {c}+\sqrt {c \,x^{2}+a}\right )}{2 c^{\frac {3}{2}}}\right )+\frac {\left (d h +e g \right ) \sqrt {c \,x^{2}+a}}{c}+\frac {d g \ln \left (x \sqrt {c}+\sqrt {c \,x^{2}+a}\right )}{\sqrt {c}}\) \(126\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((h*x+g)*(f*x^2+e*x+d)/(c*x^2+a)^(1/2),x,method=_RETURNVERBOSE)

[Out]

h*f*(1/3*x^2/c*(c*x^2+a)^(1/2)-2/3*a/c^2*(c*x^2+a)^(1/2))+(e*h+f*g)*(1/2*x/c*(c*x^2+a)^(1/2)-1/2*a/c^(3/2)*ln(
x*c^(1/2)+(c*x^2+a)^(1/2)))+(d*h+e*g)/c*(c*x^2+a)^(1/2)+d*g*ln(x*c^(1/2)+(c*x^2+a)^(1/2))/c^(1/2)

________________________________________________________________________________________

Maxima [A]
time = 0.27, size = 129, normalized size = 0.95 \begin {gather*} \frac {\sqrt {c x^{2} + a} f h x^{2}}{3 \, c} + \frac {d g \operatorname {arsinh}\left (\frac {c x}{\sqrt {a c}}\right )}{\sqrt {c}} + \frac {\sqrt {c x^{2} + a} d h}{c} - \frac {2 \, \sqrt {c x^{2} + a} a f h}{3 \, c^{2}} + \frac {\sqrt {c x^{2} + a} {\left (f g + h e\right )} x}{2 \, c} - \frac {{\left (f g + h e\right )} a \operatorname {arsinh}\left (\frac {c x}{\sqrt {a c}}\right )}{2 \, c^{\frac {3}{2}}} + \frac {\sqrt {c x^{2} + a} g e}{c} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)*(f*x^2+e*x+d)/(c*x^2+a)^(1/2),x, algorithm="maxima")

[Out]

1/3*sqrt(c*x^2 + a)*f*h*x^2/c + d*g*arcsinh(c*x/sqrt(a*c))/sqrt(c) + sqrt(c*x^2 + a)*d*h/c - 2/3*sqrt(c*x^2 +
a)*a*f*h/c^2 + 1/2*sqrt(c*x^2 + a)*(f*g + h*e)*x/c - 1/2*(f*g + h*e)*a*arcsinh(c*x/sqrt(a*c))/c^(3/2) + sqrt(c
*x^2 + a)*g*e/c

________________________________________________________________________________________

Fricas [A]
time = 0.39, size = 205, normalized size = 1.51 \begin {gather*} \left [\frac {3 \, {\left (a h e - {\left (2 \, c d - a f\right )} g\right )} \sqrt {c} \log \left (-2 \, c x^{2} + 2 \, \sqrt {c x^{2} + a} \sqrt {c} x - a\right ) + 2 \, {\left (2 \, c f h x^{2} + 3 \, c f g x + 2 \, {\left (3 \, c d - 2 \, a f\right )} h + 3 \, {\left (c h x + 2 \, c g\right )} e\right )} \sqrt {c x^{2} + a}}{12 \, c^{2}}, \frac {3 \, {\left (a h e - {\left (2 \, c d - a f\right )} g\right )} \sqrt {-c} \arctan \left (\frac {\sqrt {-c} x}{\sqrt {c x^{2} + a}}\right ) + {\left (2 \, c f h x^{2} + 3 \, c f g x + 2 \, {\left (3 \, c d - 2 \, a f\right )} h + 3 \, {\left (c h x + 2 \, c g\right )} e\right )} \sqrt {c x^{2} + a}}{6 \, c^{2}}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)*(f*x^2+e*x+d)/(c*x^2+a)^(1/2),x, algorithm="fricas")

[Out]

[1/12*(3*(a*h*e - (2*c*d - a*f)*g)*sqrt(c)*log(-2*c*x^2 + 2*sqrt(c*x^2 + a)*sqrt(c)*x - a) + 2*(2*c*f*h*x^2 +
3*c*f*g*x + 2*(3*c*d - 2*a*f)*h + 3*(c*h*x + 2*c*g)*e)*sqrt(c*x^2 + a))/c^2, 1/6*(3*(a*h*e - (2*c*d - a*f)*g)*
sqrt(-c)*arctan(sqrt(-c)*x/sqrt(c*x^2 + a)) + (2*c*f*h*x^2 + 3*c*f*g*x + 2*(3*c*d - 2*a*f)*h + 3*(c*h*x + 2*c*
g)*e)*sqrt(c*x^2 + a))/c^2]

________________________________________________________________________________________

Sympy [A]
time = 3.83, size = 282, normalized size = 2.07 \begin {gather*} \frac {\sqrt {a} e h x \sqrt {1 + \frac {c x^{2}}{a}}}{2 c} + \frac {\sqrt {a} f g x \sqrt {1 + \frac {c x^{2}}{a}}}{2 c} - \frac {a e h \operatorname {asinh}{\left (\frac {\sqrt {c} x}{\sqrt {a}} \right )}}{2 c^{\frac {3}{2}}} - \frac {a f g \operatorname {asinh}{\left (\frac {\sqrt {c} x}{\sqrt {a}} \right )}}{2 c^{\frac {3}{2}}} + d g \left (\begin {cases} \frac {\sqrt {- \frac {a}{c}} \operatorname {asin}{\left (x \sqrt {- \frac {c}{a}} \right )}}{\sqrt {a}} & \text {for}\: a > 0 \wedge c < 0 \\\frac {\sqrt {\frac {a}{c}} \operatorname {asinh}{\left (x \sqrt {\frac {c}{a}} \right )}}{\sqrt {a}} & \text {for}\: a > 0 \wedge c > 0 \\\frac {\sqrt {- \frac {a}{c}} \operatorname {acosh}{\left (x \sqrt {- \frac {c}{a}} \right )}}{\sqrt {- a}} & \text {for}\: c > 0 \wedge a < 0 \end {cases}\right ) + d h \left (\begin {cases} \frac {x^{2}}{2 \sqrt {a}} & \text {for}\: c = 0 \\\frac {\sqrt {a + c x^{2}}}{c} & \text {otherwise} \end {cases}\right ) + e g \left (\begin {cases} \frac {x^{2}}{2 \sqrt {a}} & \text {for}\: c = 0 \\\frac {\sqrt {a + c x^{2}}}{c} & \text {otherwise} \end {cases}\right ) + f h \left (\begin {cases} - \frac {2 a \sqrt {a + c x^{2}}}{3 c^{2}} + \frac {x^{2} \sqrt {a + c x^{2}}}{3 c} & \text {for}\: c \neq 0 \\\frac {x^{4}}{4 \sqrt {a}} & \text {otherwise} \end {cases}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)*(f*x**2+e*x+d)/(c*x**2+a)**(1/2),x)

[Out]

sqrt(a)*e*h*x*sqrt(1 + c*x**2/a)/(2*c) + sqrt(a)*f*g*x*sqrt(1 + c*x**2/a)/(2*c) - a*e*h*asinh(sqrt(c)*x/sqrt(a
))/(2*c**(3/2)) - a*f*g*asinh(sqrt(c)*x/sqrt(a))/(2*c**(3/2)) + d*g*Piecewise((sqrt(-a/c)*asin(x*sqrt(-c/a))/s
qrt(a), (a > 0) & (c < 0)), (sqrt(a/c)*asinh(x*sqrt(c/a))/sqrt(a), (a > 0) & (c > 0)), (sqrt(-a/c)*acosh(x*sqr
t(-c/a))/sqrt(-a), (c > 0) & (a < 0))) + d*h*Piecewise((x**2/(2*sqrt(a)), Eq(c, 0)), (sqrt(a + c*x**2)/c, True
)) + e*g*Piecewise((x**2/(2*sqrt(a)), Eq(c, 0)), (sqrt(a + c*x**2)/c, True)) + f*h*Piecewise((-2*a*sqrt(a + c*
x**2)/(3*c**2) + x**2*sqrt(a + c*x**2)/(3*c), Ne(c, 0)), (x**4/(4*sqrt(a)), True))

________________________________________________________________________________________

Giac [A]
time = 4.33, size = 110, normalized size = 0.81 \begin {gather*} \frac {1}{6} \, \sqrt {c x^{2} + a} {\left ({\left (\frac {2 \, f h x}{c} + \frac {3 \, {\left (c^{2} f g + c^{2} h e\right )}}{c^{3}}\right )} x + \frac {2 \, {\left (3 \, c^{2} d h - 2 \, a c f h + 3 \, c^{2} g e\right )}}{c^{3}}\right )} - \frac {{\left (2 \, c d g - a f g - a h e\right )} \log \left ({\left | -\sqrt {c} x + \sqrt {c x^{2} + a} \right |}\right )}{2 \, c^{\frac {3}{2}}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)*(f*x^2+e*x+d)/(c*x^2+a)^(1/2),x, algorithm="giac")

[Out]

1/6*sqrt(c*x^2 + a)*((2*f*h*x/c + 3*(c^2*f*g + c^2*h*e)/c^3)*x + 2*(3*c^2*d*h - 2*a*c*f*h + 3*c^2*g*e)/c^3) -
1/2*(2*c*d*g - a*f*g - a*h*e)*log(abs(-sqrt(c)*x + sqrt(c*x^2 + a)))/c^(3/2)

________________________________________________________________________________________

Mupad [B]
time = 5.17, size = 227, normalized size = 1.67 \begin {gather*} \left \{\begin {array}{cl} \frac {2\,f\,g\,x^3+3\,e\,g\,x^2+6\,d\,g\,x}{6\,\sqrt {a}}+\frac {3\,f\,h\,x^4+4\,e\,h\,x^3+6\,d\,h\,x^2}{12\,\sqrt {a}} & \text {\ if\ \ }c=0\\ \frac {d\,g\,\ln \left (\sqrt {c}\,x+\sqrt {c\,x^2+a}\right )}{\sqrt {c}}+\frac {d\,h\,\sqrt {c\,x^2+a}}{c}+\frac {e\,g\,\sqrt {c\,x^2+a}}{c}+\frac {e\,h\,x\,\sqrt {c\,x^2+a}}{2\,c}+\frac {f\,g\,x\,\sqrt {c\,x^2+a}}{2\,c}-\frac {f\,h\,\sqrt {c\,x^2+a}\,\left (2\,a-c\,x^2\right )}{3\,c^2}-\frac {a\,e\,h\,\ln \left (2\,\sqrt {c}\,x+2\,\sqrt {c\,x^2+a}\right )}{2\,c^{3/2}}-\frac {a\,f\,g\,\ln \left (2\,\sqrt {c}\,x+2\,\sqrt {c\,x^2+a}\right )}{2\,c^{3/2}} & \text {\ if\ \ }c\neq 0 \end {array}\right . \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((g + h*x)*(d + e*x + f*x^2))/(a + c*x^2)^(1/2),x)

[Out]

piecewise(c == 0, (3*e*g*x^2 + 2*f*g*x^3 + 6*d*g*x)/(6*a^(1/2)) + (6*d*h*x^2 + 4*e*h*x^3 + 3*f*h*x^4)/(12*a^(1
/2)), c ~= 0, (d*g*log(c^(1/2)*x + (a + c*x^2)^(1/2)))/c^(1/2) + (d*h*(a + c*x^2)^(1/2))/c + (e*g*(a + c*x^2)^
(1/2))/c + (e*h*x*(a + c*x^2)^(1/2))/(2*c) + (f*g*x*(a + c*x^2)^(1/2))/(2*c) - (f*h*(a + c*x^2)^(1/2)*(2*a - c
*x^2))/(3*c^2) - (a*e*h*log(2*c^(1/2)*x + 2*(a + c*x^2)^(1/2)))/(2*c^(3/2)) - (a*f*g*log(2*c^(1/2)*x + 2*(a +
c*x^2)^(1/2)))/(2*c^(3/2)))

________________________________________________________________________________________